import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class Settings extends Frame implements ActionListener{
	  
	  public static void main(String[] args) {
			
			Settings v = new Settings();
		}
	  Label la_sur =new Label();
	  Label la_first = new Label();
	  Label la_birth = new Label();
	  Label la_mail = new Label();
	  Label la_comp = new Label();
	  Label la_symbol = new Label();
	  Label la_unit = new Label();
	  Label la_jobtitle = new Label();
	  Label la_start = new Label();
	  Label la_end =new Label();
	  Label la_trainer = new Label();
	  TextField tf_sur = new TextField();
	  TextField tf_first = new TextField();
	  TextField tf_birth = new TextField();
	  TextField tf_mail = new TextField();
	  TextField tf_comp = new TextField();
	  TextField tf_symbol = new TextField();
	  TextField tf_unit = new TextField();
	  TextField tf_jobtitle = new TextField();
	  TextField tf_trainer = new TextField();
	  TextField tf_start = new TextField();
	  TextField tf_end = new TextField();
	  Button btn_save=new Button ();
	  Button btn_browse=new Button ();
	  Button btn_cancel=new Button ();
	  Checkbox cb_agb = new Checkbox("AGB's akzeptieren");
	  
	  
	 

	  
	  
	  private Settings view = null;
		
		public Settings() {
		
		view = ( new Settings("Einstellungen") );
		
		getView().setLayout(null);
		
	 
		//Label Nachname
		getView().getLa_first().setBounds( 30, 60, 90, 20);
		getView().getLa_first().setText("Name");
		getView().add( getView().getLa_first());
		
		//Textfeld Nachname
		getView().getTf_first().setBounds( 150, 60, 250, 20);
		getView().getTf_first().setText("");
		getView().add( getView().getTf_first());
	  
		//Label Vorname
		getView().getLa_sur().setBounds( 30, 90, 90, 20);
		getView().getLa_sur().setText("Vorname");
		getView().add( getView().getLa_sur());
				
		//Textfeld Vorname
		getView().getTf_sur().setBounds( 150, 90, 250, 20);
		getView().getTf_sur().setText("");
		getView().add( getView().getTf_sur());
	  	  
		//Label Geburtsdatum
		getView().getLa_birth().setBounds( 30, 120, 90, 20);
		getView().getLa_birth().setText("Geburtsdatum");
		getView().add( getView().getLa_birth());
				
		//Textfeld Geburtsdatum
		getView().getTf_birth().setBounds( 150, 120, 250, 20);
		getView().getTf_birth().setText("");
		getView().add( getView().getTf_birth());
				
		//Label eMail
		getView().getLa_mail().setBounds( 30, 150, 90, 20);
		getView().getLa_mail().setText("eMail");
		getView().add( getView().getLa_mail());
				
		//Textfeld eMail
		getView().getTf_mail().setBounds( 150, 150, 250, 20);
		getView().getTf_mail().setText("");
		getView().add( getView().getTf_mail());
				
		//Label Ausbildungsberuf
		getView().getLa_jobtitle().setBounds( 30, 180, 100, 20);
		getView().getLa_jobtitle().setText("Ausbildungsberuf");
		getView().add( getView().getLa_jobtitle());
				
		//Textfeld Ausbildungsberuf
		getView().getTf_jobtitle().setBounds( 150, 180, 250, 20);
		getView().getTf_jobtitle().setText("");
		getView().add( getView().getTf_jobtitle());
				
		//Label Ausbildungsbetrieb
		getView().getLa_comp().setBounds( 30, 210, 90, 20);
		getView().getLa_comp().setText("Firma");
		getView().add( getView().getLa_comp());
				
		//Textfeld Ausbildungsbetrieb
		getView().getTf_comp().setBounds( 150, 210, 250, 20);
		getView().getTf_comp().setText("");
		getView().add( getView().getTf_comp());
	  
		//Label Abteilung
		getView().getLa_unit().setBounds( 30, 240, 90, 20);
		getView().getLa_unit().setText("Abteilung");
		getView().add( getView().getLa_unit());
				
		//Textfeld Abteilung
		getView().getTf_unit().setBounds( 150, 240, 250, 20);
		getView().getTf_unit().setText("");
		getView().add( getView().getTf_unit());
				
		//Label Ausbilder
		getView().getLa_trainer().setBounds( 30, 270, 100, 20);
		getView().getLa_trainer().setText("Name Ausbilder");
		getView().add( getView().getLa_trainer());
				
		//Textfeld Ausbilder
		getView().getTf_trainer().setBounds( 150, 270, 250, 20);
		getView().getTf_trainer().setText("");
		getView().add( getView().getTf_trainer());
				
		//Label Ausbildungsbeginn
		getView().getLa_start().setBounds( 30, 300, 110, 20);
		getView().getLa_start().setText("Ausbildungsbeginn");
		getView().add( getView().getLa_start());
				
		//Textfeld Ausbildungsbeginn
		getView().getTf_start().setBounds( 150, 300, 250, 20);
		getView().getTf_start().setText("");
		getView().add( getView().getTf_start());
	  
		//Label Ausbildungsende
		getView().getLa_end().setBounds( 30, 330, 100, 20);
		getView().getLa_end().setText("Ausbildungsende");
		getView().add( getView().getLa_end());
				
		//Textfeld Ausbildungsende
		getView().getTf_end().setBounds( 150, 330, 250, 20);
		getView().getTf_end().setText("");
		getView().add( getView().getTf_end());
				
		//Label Firmenlogo
		getView().getLa_symbol().setBounds( 30, 360, 90, 20);
		getView().getLa_symbol().setText("Firmenlogo");
		getView().add( getView().getLa_symbol());
				
		//Firmenlogo
		getView().getTf_symbol().setBounds( 150, 360, 250, 20);
		getView().getTf_symbol().setText("");
		getView().add( getView().getTf_symbol());
				
		//Button Browse
		getView().getBtn_browse().setBounds( 410,360, 60, 20);
		getView().getBtn_browse().setLabel("Browse...");
		getView().add( getView().getBtn_browse());
		
		//Button Speichern
		getView().getBtn_save().setBounds( 300,405, 80, 25);
		getView().getBtn_save().setLabel("Speichern");
		getView().add( getView().getBtn_save());
				
		//Button Cancel
		getView().getBtn_cancel().setBounds( 390,405, 80, 25);
		getView().getBtn_cancel().setLabel("Abbrechen");
		getView().add( getView().getBtn_cancel());
				
	  getView().getBtn_cancel().addActionListener(this);
	  getView().getBtn_save().addActionListener(this);
	  getView().getBtn_browse().addActionListener(this);
				
	  getView().setSize(500, 450 );
	  getView().setVisible(true);
		}
		
		public Settings getView() {
			return view;
		}

		public void setView(Settings view) {
			this.view = view;
		}
	  
	  public Settings(String Title) {
			super(Title);
	  addWindowListener(new WindowAdapter(){
	  public void windowClosing(WindowEvent we){
	  dispose();
	  }
	  });
	  }
	  
	  public void MouseClickedCa(ActionEvent e) {
		  getView().dispose();
	  
	}
	 
	  public void MouseClickedBr(ActionEvent e) {
		  //search symbol	  
	}
	  
	  public void MouseClickedSa(ActionEvent e) {
			//create a document
		}
	  @Override
		public void actionPerformed(ActionEvent e) {
			if(e.getSource() == getView().getBtn_cancel()){
				MouseClickedCa(e);
			}
			if(e.getSource() == getView().getBtn_save()){
				getView().MouseClickedSa(e);
				}
			if(e.getSource() == getView().getBtn_browse()){
				getView().MouseClickedBr(e);
				}
	  }
			
			
			public void setCb_agb(Checkbox cb_agb) {
				this.cb_agb = cb_agb;
			}
			
			public Checkbox getCb_agb() {
				return cb_agb;
			}
				
				public void setBtn_save(Button btn_save) {
					this.btn_save = btn_save;
				}
				public Button getBtn_save() {
					return btn_save;
				}
				
				public void setBtn_browse(Button btn_browse) {
					this.btn_browse = btn_browse;
				}
				public Button getBtn_browse() {
					return btn_browse;
				}
				
				public void setBtn_cancel(Button btn_cancel) {
					this.btn_cancel = btn_cancel;
				}

				public Button getBtn_cancel() {
					return btn_cancel;
				}
				
				//Labels				
				public void setLa_sur(Label la_sur){
					this.la_sur = la_sur;
				}
				public Label getLa_sur() {
					return la_sur;
				}
				
				public void setLa_first(Label la_first){
					this.la_first = la_first;
				}
				public Label getLa_first() {
					return la_first;
				}
				
				public void setLa_birth(Label la_birth){
					this.la_birth = la_birth;
				}
				public Label getLa_birth() {
					return la_birth;
				}
				
				public void setLa_mail(Label la_mail){
					this.la_mail = la_mail;
				}
				public Label getLa_mail() {
					return la_mail;
				}
				
				public void setLa_jobtitle(Label la_jobtitle){
					this.la_jobtitle = la_jobtitle;
				}
				public Label getLa_jobtitle() {
					return la_jobtitle;
				}
				
				public void setLa_comp(Label la_comp){
					this.la_comp = la_comp;
				}
				public Label getLa_comp() {
					return la_comp;
				}
				
				public void setLa_unit(Label la_unit){
					this.la_unit = la_unit;
				}
				public Label getLa_unit(){
					return la_unit;
				}
				
				public void setLa_trainer(Label la_trainer){
					this.la_trainer = la_trainer;
				}
				public Label getLa_trainer() {
					return la_trainer;
				}
				
				public void setLa_start(Label la_start){
					this.la_start = la_start;
				}
				public Label getLa_start() {
					return la_start;
				}
				
				public void setLa_end(Label la_end){
					this.la_end = la_end;
				}
				public Label getLa_end() {
					return la_end;
				}
				
				public void setLa_symbol(Label la_symbol){
					this.la_symbol = la_symbol;
				}
				public Label getLa_symbol() {
					return la_symbol;
				}
				
				
				
								
				//TextFields
				public TextField getTf_sur() {
					return tf_sur;
				}
				public void setTf_sur(TextField tf_sur) {
					this.tf_sur = tf_sur;
				}
				
				public TextField getTf_first() {
					return tf_first;
				}
				public void setTf_first(TextField tf_first) {
					this.tf_first = tf_first;
				}

				public TextField getTf_birth() {
					return tf_birth;
				}
				public void setTf_birth(TextField tf_birth) {
					this.tf_birth = tf_birth;
				}
				
				public TextField getTf_mail() {
					return tf_mail;
				}
				public void setTf_mail(TextField tf_mail) {
					this.tf_mail = tf_mail;
				}
				
				public TextField getTf_jobtitle() {
					return tf_jobtitle;
				}
				public void setTf_jobtitle(TextField tf_jobtitle) {
					this.tf_jobtitle = tf_jobtitle;
				}

				public TextField getTf_comp() {
					return tf_comp;
				}
				public void setTf_comp(TextField tf_comp) {
					this.tf_comp = tf_comp;
				}
				
				public TextField getTf_unit() {
					return tf_unit;
				}
				public void setTf_unit(TextField tf_unit) {
					this.tf_unit = tf_unit;
				}
								
				public TextField getTf_trainer() {
					return tf_trainer;
				}
				public void setTf_trainer(TextField tf_trainer) {
					this.tf_trainer = tf_trainer;
				}
				
				public TextField getTf_start() {
					return tf_start;
				}
				public void setTf_start(TextField tf_start) {
					this.tf_start = tf_start;
				}

				public TextField getTf_end() {
					return tf_end;
				}
				public void setTf_end(TextField tf_end) {
					this.tf_end = tf_end;
				}
				
				public TextField getTf_symbol() {
					return tf_symbol;
				}
				public void setTf_symbol(TextField tf_symbol) {
					this.tf_symbol = tf_symbol;
				}
				
	  }
	  




